package com.zyp.messageboard.service.impl;

import com.zyp.messageboard.dao.UserDao;
import com.zyp.messageboard.dao.impl.UserDaoImpl;
import com.zyp.messageboard.entity.User;
import com.zyp.messageboard.service.UserService;

public class UserServiceImpl implements UserService {

    private final UserDao userDao = new UserDaoImpl();

    @Override
    public User findById(Integer id) {
        return userDao.findById(id);
    }

    @Override
    public User findByUsername(String username) {
        return userDao.findByUsername(username);
    }

    @Override
    public User findByRememberMeToken(String token) {
        return userDao.findByRememberMeToken(token);
    }

    @Override
    public void save(User user) {
        userDao.save(user);
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public void delete(Integer id) {
        userDao.delete(id);
    }

    @Override
    public void updateOnlineStatus(Integer userId, Boolean onlineStatus) {
        userDao.updateOnlineStatus(userId, onlineStatus);
    }
}
